<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_BOM操作</title>
</head>
<body>
<button onclick="alert('请先登录！')">登录</button>
<button onclick="confirm('是否删除？')">删除</button>

<script>
    /*window对象，是浏览器内置的全局对象，无需导包或创建对象即可使用*/
    //parseInt 将参数转为整数，舍弃小数点后的部分，字符串无法转换
    console.log(parseInt(6.4));
    console.log(parseInt(22.1));
    console.log(parseInt('12.11'));
    console.log(parseInt(2));
    console.log(parseInt('hehe'));
    console.log(parseInt(0.1));
    //parseInt 将参数转换为小数，字符串无法转换
    console.log(parseFloat(6.4));
    console.log(parseFloat(6));
    console.log(parseFloat(64));
    console.log(parseFloat('hehe'));
    console.log(parseFloat('哈哈'));
    //isNaN() 判断参数是否为非数字，如果是非数字返回true，否则返回false
    console.log(isNaN('HEHE'));//true
    console.log(isNaN(666));//false
    console.log(isNaN('3.02'));//false
    console.log(isNaN('66'));//false
    console.log(isNaN('哈哈'));//true



</script>



</body>
</html>